﻿using System;
using System.Runtime.Serialization;
using System.Security;
using EasyComm.Workstation.Info;

namespace EasyComm.Workstation
{
    [Serializable]
    public class Computer : ISystemObject
    {
        public int ID { get; private set; }
        public string Name { get; private set; }
        public string Address { get; private set; }
        public string Domain { get; set; }
        public string UserName { get; set; }
        public SecureString Password { get; set; }

        [NonSerialized]
        private Memory _memoryAllocation;
        public Memory MemoryAllocation
        {
            get
            {
                return _memoryAllocation;
            }
            private set
            {
                _memoryAllocation = value;
            }
        }

        public int MaxProcesses { get; set; }
        public int MaxThreads { get; set; }
        public int MaxMemoryAllocation { get; set; }
        public int MaxCPUAllocationPercent { get; set; }

        [NonSerialized]
        private CPUCollection _cpuList;
        public CPUCollection CPUList
        {
            get
            {
                return _cpuList;
            }
            private set
            {
                _cpuList = value;
            }
        }

        public Computer()
        {

        }

        [OnDeserialized]
        private void SetValuesOnDeserialized(StreamingContext context)
        {
            // Code not shown.
        }
    }
}
